{# Stalker Pyramid a Web Base Production Asset Management System
 Copyright (C) 2009-2014 Erkan Ozgur Yilmaz

 This file is part of Stalker Pyramid.

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation;
 version 2.1 of the License.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#}

{% extends "base.jinja2" %}

{% block sidebar %}
        {% include 'sidebar.jinja2' %}
{% endblock sidebar %}



{% block page_content %}
    <div class='column-fluid'>
        <div class='row-fluid'>
            <div class='span8 offset2'>
                <h3 class='text-center'>My Tasks Today</h3>
                <table class='table table-hover'>
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Start</th>
                            <th>End</th>
                            <th>Completed</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% for task in tasks_today %}
                        <tr class={% if task.percent_complete == 0 %}'danger'{% elif task.percent_complete >= 100 %}'success'{% else %}'warning'{% endif %}>
                            <td>{{ task.id }}</td>
                            <td><a href='{{ request.route_url('view_task', id=task.id) }}'>{{ task.name }}</a></td>
                            <td>{{ task.start }}</td>
                            <td>{{ task.end }}</td>
                            <td>%{{ '%i' | format(task.percent_complete) }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>

        <div class='row-fluid'>
            <div class='span8 offset2'>
                <h3 class='text-center'>My Projects</h3>
                <table class='table table-hover'>
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Start</th>
                            <th>End</th>
                            <th>Completed</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% for project in logged_in_user.projects %}
                        <tr class={% if project.percent_complete == 0 %}'error'{% elif project.percent_complete >= 100 %}'success'{% else %}'warning'{% endif %}>
                            <td>{{ project.id }}</td>
                            <td><a href='{{ request.route_url('view_project', id=project.id) }}'>{{ project.name }}</a></td>
                            <td>{{ project.start }}</td>
                            <td>{{ project.end }}</td>
                            <td>%{{ '%i' | format(project.percent_complete) }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>

        </div>
    </div>    
{% endblock page_content %}
